const mysql = require('../utils/data/mysql')
const db = require('../utils/datastore.js')

module.exports = {
    //初始化
    init: () => {
        this.getDataTable();
    },
    /**
     *获取数据表信息结构
     */
    getDataTable: ()=>{
        let me = this;
        let config = {
            sql: 'SELECT table_name name,TABLE_COMMENT value FROM INFORMATION_SCHEMA.TABLES WHERE table_type= ? and table_schema = ? order by table_name asc',
            params : ['base table' , mysql.config.database]
        }
        //查询表结构
        mysql.exec(config, (res) => {
            if(res){
                db.read().set('table',res).write();
            }
        })
    },
    /**
     * 获取功能业务信息结构
     */
    getFunction: () => {

    },
    /**
     * 获取流程信息结构
     */
    getFlow: () => {

    }


}